package com.zgjkhis.modules.system.service.mapper;

import com.zgjkhis.common.mapper.CoreMapper;
import com.zgjkhis.modules.system.domain.TcmDiseases;
import com.zgjkhis.modules.system.service.dto.TcmDiseasesQueryCriteria;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author yzq
 * @Description 诊断
 * @Date 2021/6/23 9:48
 * @Param
 * @return
 **/
@Repository
public interface TcmDiseasesMapper extends CoreMapper<TcmDiseases> {


    @Select("<script>select * from his_tcm_diseases t where 1=1" +
            "<if test=\"tcm.diseasesName!=null and tcm.diseasesName!=''\">\n" +
            "\t and (t.diseases_name LIKE CONCAT('%',#{tcm.diseasesName},'%') or t.pinyin_code LIKE CONCAT('%',#{tcm.diseasesName},'%'))\n" +
            "</if>\n" +
            " order by tcm_diseases_id asc"+
  "</script>")
    List<TcmDiseases> queryAll(@Param("tcm") TcmDiseasesQueryCriteria criteria);
}
